package com.justic.zk.quartz.curator;

/** 
 * @Title:Curator封装接口类  
 * @Desription:Curator封装接口类
 * @Company:CSN
 * @ClassName:ICuratorWrapper.java
 * @Author:Justic
 * @CreateDate:2015-7-1   
 * @UpdateUser:Justic  
 * @Version:0.1 
 *    
 */



import java.util.List;
import java.util.Map;

import org.apache.curator.framework.CuratorFramework;

import com.justic.zk.quartz.curator.support.NodeMode;

/**
 * @ClassName: ICuratorWrapper
 * @Description: Curator封装接口类
 * @author: Justic
 * @date: 2015-7-1
 * 
 */
public interface ICuratorWrapper {

	public static final String DEFAULT_GROUP_NAME = "/amms2-schedule";
	public static final int CONNECTION_TIMEOUT_MS = 15000;
	public static final int SESSION_TIMEOUT_MS = 6000;

	public void createNode() throws Exception;

	public void createNode(String nodePath) throws Exception;

	public void createNode(String nodePath, String value) throws Exception;

	public void addPathChildrenListener() throws Exception;
	
	public void addPathChildrenListener(String nodePath)throws Exception;

	public CuratorFramework getClient();

	public boolean isStart();

	public void start();

	public void close();

	public String getRootPath();

	public String getNodeName();

	public boolean isLeader();

	public void setNodeMode(NodeMode nodeMode);
	
	public boolean updateNode(String nodePath,String value)throws Exception;
	
	public void deleteNode(String nodePath) throws Exception;
	
	public List<String> listChildren(String nodePath)throws Exception;
	
	public Map<String, String> listchildrenDetail(String nodePath)throws Exception;

}
